package com.liu.project.service.impl;

import com.liu.project.dao.CertificateMapper;
import com.liu.project.kmeans.Kmeans_data;
import com.liu.project.pojo.CKmeas;
import com.liu.project.pojo.Certificate;
import com.liu.project.service.CertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: project
 * @description: 证书实现类
 * @author: 86187
 * @create: 2022-02-16 16:05
 **/

@Service
public class CertificateServiceImpl  implements CertificateService {


    @Autowired
    CertificateMapper certificateMapper;
    @Override
    public List<Certificate> findAllCertificate() {
        return certificateMapper.findAllCertificate();
    }

    @Override
    public Certificate findCertificateById(int cid) {
        return certificateMapper.findCertificateById(cid);
    }

    @Override
    public List<Certificate> findCertificateBySid(int sid) {
        return certificateMapper.findCertificateBySid(sid);
    }



    @Override
    public List<Certificate> findCertificateByKey(String name) {
        return certificateMapper.findCertificateByKey(name);
    }

    @Override
    public boolean insertCertificate(Certificate certificate) {
        int i = certificateMapper.insertCertificate(certificate);
        return i>0;
    }

    @Override
    public boolean updateCertificate(Certificate certificate) {
        int i = certificateMapper.updateCertificate(certificate);
        return i>0;
    }

    @Override
    public boolean deleteCertificate(int cid) {
        int i = certificateMapper.deleteCertificate(cid);
        return i>0;
    }

    @Override
    public List<CKmeas> getXAndY() {
        return certificateMapper.getXAndY();
    }


}
